. as $root | 
  [$root.cves[] | select(.severity == "critical") | .id] as $critical_cves |
  (["| CVE ID        | Package |",
    "| ------------- | ------- |"] +
   [$root.packages[] | 
    select(.cve_id as $cve | $critical_cves | contains([$cve])) | 
    "| \(.cve_id)  | \(.name) |"]) | 
  .[]
